/**
 * This is a generated class and is not intended for modification.  To customize behavior
 * of this value object you may modify the generated sub-class of this class - PacienteVO.as.
 */

package valueObjects
{
import com.adobe.fiber.services.IFiberManagingService;
import com.adobe.fiber.valueobjects.IValueObject;
import flash.events.EventDispatcher;
import mx.collections.ArrayCollection;
import mx.events.PropertyChangeEvent;

import flash.net.registerClassAlias;
import flash.net.getClassByAlias;
import com.adobe.fiber.core.model_internal;
import com.adobe.fiber.valueobjects.IPropertyIterator;
import com.adobe.fiber.valueobjects.AvailablePropertyIterator;

use namespace model_internal;

[ExcludeClass]
public class _Super_PacienteVO extends flash.events.EventDispatcher implements com.adobe.fiber.valueobjects.IValueObject
{
    model_internal static function initRemoteClassAliasSingle(cz:Class) : void
    {
        try
        {
            if (flash.net.getClassByAlias("com.tham.vo.PacienteVO") == null)
            {
                flash.net.registerClassAlias("com.tham.vo.PacienteVO", cz);
            }
        }
        catch (e:Error)
        {
            flash.net.registerClassAlias("com.tham.vo.PacienteVO", cz);
        }
    }

    model_internal static function initRemoteClassAliasAllRelated() : void
    {
    }

    model_internal var _dminternal_model : _PacienteVOEntityMetadata;
    model_internal var _changedObjects:mx.collections.ArrayCollection = new ArrayCollection();

    public function getChangedObjects() : Array
    {
        _changedObjects.addItemAt(this,0);
        return _changedObjects.source;
    }

    public function clearChangedObjects() : void
    {
        _changedObjects.removeAll();
    }

    /**
     * properties
     */
    private var _internal_telefonos : String;
    private var _internal_direccion : String;
    private var _internal_poblacion : String;
    private var _internal_idComuna : String;
    private var _internal_apellidoP : String;
    private var _internal_fechaNac : String;
    private var _internal_activoSN : String;
    private var _internal_sexo : String;
    private var _internal_nombre : String;
    private var _internal_correoElectronico : String;
    private var _internal_idPpais : String;
    private var _internal_rut : String;
    private var _internal_apellidoM : String;
    private var _internal_digitoRut : String;
    private var _internal_usuarioCambio : String;
    private var _internal_telefonosMoviles : String;

    private static var emptyArray:Array = new Array();


    /**
     * derived property cache initialization
     */
    model_internal var _cacheInitialized_isValid:Boolean = false;

    model_internal var _changeWatcherArray:Array = new Array();

    public function _Super_PacienteVO()
    {
        _model = new _PacienteVOEntityMetadata(this);

        // Bind to own data or source properties for cache invalidation triggering

    }

    /**
     * data/source property getters
     */

    [Bindable(event="propertyChange")]
    public function get telefonos() : String
    {
        return _internal_telefonos;
    }

    [Bindable(event="propertyChange")]
    public function get direccion() : String
    {
        return _internal_direccion;
    }

    [Bindable(event="propertyChange")]
    public function get poblacion() : String
    {
        return _internal_poblacion;
    }

    [Bindable(event="propertyChange")]
    public function get idComuna() : String
    {
        return _internal_idComuna;
    }

    [Bindable(event="propertyChange")]
    public function get apellidoP() : String
    {
        return _internal_apellidoP;
    }

    [Bindable(event="propertyChange")]
    public function get fechaNac() : String
    {
        return _internal_fechaNac;
    }

    [Bindable(event="propertyChange")]
    public function get activoSN() : String
    {
        return _internal_activoSN;
    }

    [Bindable(event="propertyChange")]
    public function get sexo() : String
    {
        return _internal_sexo;
    }

    [Bindable(event="propertyChange")]
    public function get nombre() : String
    {
        return _internal_nombre;
    }

    [Bindable(event="propertyChange")]
    public function get correoElectronico() : String
    {
        return _internal_correoElectronico;
    }

    [Bindable(event="propertyChange")]
    public function get idPpais() : String
    {
        return _internal_idPpais;
    }

    [Bindable(event="propertyChange")]
    public function get rut() : String
    {
        return _internal_rut;
    }

    [Bindable(event="propertyChange")]
    public function get apellidoM() : String
    {
        return _internal_apellidoM;
    }

    [Bindable(event="propertyChange")]
    public function get digitoRut() : String
    {
        return _internal_digitoRut;
    }

    [Bindable(event="propertyChange")]
    public function get usuarioCambio() : String
    {
        return _internal_usuarioCambio;
    }

    [Bindable(event="propertyChange")]
    public function get telefonosMoviles() : String
    {
        return _internal_telefonosMoviles;
    }

    public function clearAssociations() : void
    {
    }

    /**
     * data/source property setters
     */

    public function set telefonos(value:String) : void
    {
        var oldValue:String = _internal_telefonos;
        if (oldValue !== value)
        {
            _internal_telefonos = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "telefonos", oldValue, _internal_telefonos));
        }
    }

    public function set direccion(value:String) : void
    {
        var oldValue:String = _internal_direccion;
        if (oldValue !== value)
        {
            _internal_direccion = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "direccion", oldValue, _internal_direccion));
        }
    }

    public function set poblacion(value:String) : void
    {
        var oldValue:String = _internal_poblacion;
        if (oldValue !== value)
        {
            _internal_poblacion = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "poblacion", oldValue, _internal_poblacion));
        }
    }

    public function set idComuna(value:String) : void
    {
        var oldValue:String = _internal_idComuna;
        if (oldValue !== value)
        {
            _internal_idComuna = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "idComuna", oldValue, _internal_idComuna));
        }
    }

    public function set apellidoP(value:String) : void
    {
        var oldValue:String = _internal_apellidoP;
        if (oldValue !== value)
        {
            _internal_apellidoP = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "apellidoP", oldValue, _internal_apellidoP));
        }
    }

    public function set fechaNac(value:String) : void
    {
        var oldValue:String = _internal_fechaNac;
        if (oldValue !== value)
        {
            _internal_fechaNac = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "fechaNac", oldValue, _internal_fechaNac));
        }
    }

    public function set activoSN(value:String) : void
    {
        var oldValue:String = _internal_activoSN;
        if (oldValue !== value)
        {
            _internal_activoSN = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "activoSN", oldValue, _internal_activoSN));
        }
    }

    public function set sexo(value:String) : void
    {
        var oldValue:String = _internal_sexo;
        if (oldValue !== value)
        {
            _internal_sexo = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "sexo", oldValue, _internal_sexo));
        }
    }

    public function set nombre(value:String) : void
    {
        var oldValue:String = _internal_nombre;
        if (oldValue !== value)
        {
            _internal_nombre = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "nombre", oldValue, _internal_nombre));
        }
    }

    public function set correoElectronico(value:String) : void
    {
        var oldValue:String = _internal_correoElectronico;
        if (oldValue !== value)
        {
            _internal_correoElectronico = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "correoElectronico", oldValue, _internal_correoElectronico));
        }
    }

    public function set idPpais(value:String) : void
    {
        var oldValue:String = _internal_idPpais;
        if (oldValue !== value)
        {
            _internal_idPpais = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "idPpais", oldValue, _internal_idPpais));
        }
    }

    public function set rut(value:String) : void
    {
        var oldValue:String = _internal_rut;
        if (oldValue !== value)
        {
            _internal_rut = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "rut", oldValue, _internal_rut));
        }
    }

    public function set apellidoM(value:String) : void
    {
        var oldValue:String = _internal_apellidoM;
        if (oldValue !== value)
        {
            _internal_apellidoM = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "apellidoM", oldValue, _internal_apellidoM));
        }
    }

    public function set digitoRut(value:String) : void
    {
        var oldValue:String = _internal_digitoRut;
        if (oldValue !== value)
        {
            _internal_digitoRut = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "digitoRut", oldValue, _internal_digitoRut));
        }
    }

    public function set usuarioCambio(value:String) : void
    {
        var oldValue:String = _internal_usuarioCambio;
        if (oldValue !== value)
        {
            _internal_usuarioCambio = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "usuarioCambio", oldValue, _internal_usuarioCambio));
        }
    }

    public function set telefonosMoviles(value:String) : void
    {
        var oldValue:String = _internal_telefonosMoviles;
        if (oldValue !== value)
        {
            _internal_telefonosMoviles = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "telefonosMoviles", oldValue, _internal_telefonosMoviles));
        }
    }

    /**
     * Data/source property setter listeners
     *
     * Each data property whose value affects other properties or the validity of the entity
     * needs to invalidate all previously calculated artifacts. These include:
     *  - any derived properties or constraints that reference the given data property.
     *  - any availability guards (variant expressions) that reference the given data property.
     *  - any style validations, message tokens or guards that reference the given data property.
     *  - the validity of the property (and the containing entity) if the given data property has a length restriction.
     *  - the validity of the property (and the containing entity) if the given data property is required.
     */


    /**
     * valid related derived properties
     */
    model_internal var _isValid : Boolean;
    model_internal var _invalidConstraints:Array = new Array();
    model_internal var _validationFailureMessages:Array = new Array();

    /**
     * derived property calculators
     */

    /**
     * isValid calculator
     */
    model_internal function calculateIsValid():Boolean
    {
        var violatedConsts:Array = new Array();
        var validationFailureMessages:Array = new Array();

        var propertyValidity:Boolean = true;

        model_internal::_cacheInitialized_isValid = true;
        model_internal::invalidConstraints_der = violatedConsts;
        model_internal::validationFailureMessages_der = validationFailureMessages;
        return violatedConsts.length == 0 && propertyValidity;
    }

    /**
     * derived property setters
     */

    model_internal function set isValid_der(value:Boolean) : void
    {
        var oldValue:Boolean = model_internal::_isValid;
        if (oldValue !== value)
        {
            model_internal::_isValid = value;
            _model.model_internal::fireChangeEvent("isValid", oldValue, model_internal::_isValid);
        }
    }

    /**
     * derived property getters
     */

    [Transient]
    [Bindable(event="propertyChange")]
    public function get _model() : _PacienteVOEntityMetadata
    {
        return model_internal::_dminternal_model;
    }

    public function set _model(value : _PacienteVOEntityMetadata) : void
    {
        var oldValue : _PacienteVOEntityMetadata = model_internal::_dminternal_model;
        if (oldValue !== value)
        {
            model_internal::_dminternal_model = value;
            this.dispatchEvent(mx.events.PropertyChangeEvent.createUpdateEvent(this, "_model", oldValue, model_internal::_dminternal_model));
        }
    }

    /**
     * methods
     */


    /**
     *  services
     */
    private var _managingService:com.adobe.fiber.services.IFiberManagingService;

    public function set managingService(managingService:com.adobe.fiber.services.IFiberManagingService):void
    {
        _managingService = managingService;
    }

    model_internal function set invalidConstraints_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_invalidConstraints;
        // avoid firing the event when old and new value are different empty arrays
        if (oldValue !== value && (oldValue.length > 0 || value.length > 0))
        {
            model_internal::_invalidConstraints = value;
            _model.model_internal::fireChangeEvent("invalidConstraints", oldValue, model_internal::_invalidConstraints);
        }
    }

    model_internal function set validationFailureMessages_der(value:Array) : void
    {
        var oldValue:Array = model_internal::_validationFailureMessages;
        // avoid firing the event when old and new value are different empty arrays
        if (oldValue !== value && (oldValue.length > 0 || value.length > 0))
        {
            model_internal::_validationFailureMessages = value;
            _model.model_internal::fireChangeEvent("validationFailureMessages", oldValue, model_internal::_validationFailureMessages);
        }
    }


}

}
